<!DOCTYPE html>
<html>
<head>
    <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"
          type="text/css"/>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.min.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.9/css/bootstrap-dialog.min.css"
          rel="stylesheet" type="text/css"/>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.9/js/bootstrap-dialog.min.js"></script>
    <title>Reopen Dialog</title>
    <meta charset="utf-8"/>
</head>
<body>
<button id="btn-open" class="btn btn-primary btn-block">Open your dialog</button>
<script type="text/javascript">
    /**
     * This example demonstrates how to create a dialog, close it and reopen it again.
     */
    $(function () {
        // Create your dialog but do not open it.
        var dialog = new BootstrapDialog({
            title: 'Your dialog',
            message: 'This dialog can be opened and closed again and again.',
            autodestroy: false
        });

        // Use your dialog you have created above.
        $('#btn-open').on('click', {dialog: dialog}, function (event) {
            event.data.dialog.open();
        });
    });
</script>
</body>
</html>
